@extends('layouts.app')

@section('content')
    <div class="content">
        <div class="header">
            <ul class="breadcrumb">
                <li>系统设置</li>
                <li><a href="">添加保安公司考核项</a> </li>
            </ul>
        </div>
        <div class="main-content">
            <ul class="nav nav-tabs">
                <li><a href="">编辑</a></li>
            </ul>

            <div class="row">
                <div class="col-md-12">
                    <br>
                    <div id="myTabContent" class="tab-content">
                        <div class="tab-pane active in" id="home">
                            <form id="tab" class="form-horizontal" method="post">
                                <input type="hidden" name="_token" value="{{ csrf_token() }}">
                                <div class="form-group">
                                    <label for="input1" class="pull-left w120 control-label">字段内容</label>
                                    <div class="col-sm-6">
                                        <input type="text" class="form-control" name="field_content" id="field_content" placeholder="字段内容" value="{{$re->field_content}}" required>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="input2" class="pull-left w120  control-label">字段名</label>
                                    <div class="col-sm-6">
                                        <input type="text" class="form-control" name="field_name" id="field_name" placeholder="字段名" value="{{$re->field_name}}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="input3" class="pull-left w120 control-label">字段类型</label>
                                    {{--<label class="radio-inline" style="margin-left:15px;">
                                        <input type="radio" name="field_type" value="1" @if($re->field_type==1) checked @endif>单选（是否）
                                    </label>--}}
                                    <label class="radio-inline" style="margin-left:15px;">
                                        <input type="radio" name="field_type" value="2" @if($re->field_type==2) checked @endif>单选（多答案）
                                    </label>
                                    <label class="radio-inline">
                                        <input type="radio" name="field_type" value="3" @if($re->field_type==3) checked @endif>多选（多答案）
                                    </label>
                                </div>

                                <div class="daan" style="display: none">
                                    <div class="form-group">
                                        <label for="input4" class="pull-left w120 control-label">答案1</label>
                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" name="daan[]" placeholder="答案1" value="@if(isset($list['1'])){{$list['1']}}@endif">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="input4" class="pull-left w120 control-label">分数1</label>
                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" name="fenshu[]" placeholder="分数1" value="@if(isset($mark['1'])){{$mark['1']}}@endif">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="input4" class="pull-left w120 control-label">答案2</label>
                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" name="daan[]" placeholder="答案2" value="@if(isset($list['2'])){{$list['2']}}@endif">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="input4" class="pull-left w120 control-label">分数2</label>
                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" name="fenshu[]" placeholder="分数2" value="@if(isset($mark['2'])){{$mark['2']}}@endif">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="input4" class="pull-left w120 control-label">答案3</label>
                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" name="daan[]" placeholder="答案3" value="@if(isset($list['3'])){{$list['3']}}@endif">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="input4" class="pull-left w120 control-label">分数3</label>
                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" name="fenshu[]" placeholder="分数3" value="@if(isset($mark['3'])){{$mark['3']}}@endif">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="input4" class="pull-left w120 control-label">答案4</label>
                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" name="daan[]" placeholder="答案4" value="@if(isset($list['4'])){{$list['4']}}@endif">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="input4" class="pull-left w120 control-label">分数4</label>
                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" name="fenshu[]" placeholder="分数4" value="@if(isset($mark['4'])){{$mark['4']}}@endif">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="input4" class="pull-left w120 control-label">答案5</label>
                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" name="daan[]" placeholder="答案5" value="@if(isset($list['5'])){{$list['5']}}@endif">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="input4" class="pull-left w120 control-label">分数5</label>
                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" name="fenshu[]" placeholder="分数5" value="@if(isset($mark['5'])){{$mark['5']}}@endif">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="input4" class="pull-left w120 control-label">答案6</label>
                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" name="daan[]" placeholder="答案6" value="@if(isset($list['6'])){{$list['6']}}@endif">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="input4" class="pull-left w120 control-label">分数6</label>
                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" name="fenshu[]" placeholder="分数6" value="@if(isset($mark['6'])){{$mark['6']}}@endif">
                                        </div>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label for="input4" class="pull-left w120 control-label">排序</label>
                                    <div class="col-sm-6">
                                        <input type="text" class="form-control" name="paixu" id="paixu" placeholder="排序" value="{{$re->paixu}}">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="input7" class="pull-left w120 control-label">是否显示</label>
                                    <label class="radio-inline" style="margin-left:15px;">
                                        <input type="radio" name="is_show" value="1" @if($re->is_show==1) checked @endif>显示
                                    </label>
                                    <label class="radio-inline">
                                        <input type="radio" name="is_show" value="2" @if($re->is_show==2) checked @endif>隐藏
                                    </label>
                                </div>
                                <div class="btn-toolbar list-toolbar btn-toolbar2">
                                    <button class="btn btn-primary">确定</button>
                                    <a href="javascript:history.back(-1);" class="btn btn-back">返回</a>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script type="text/javascript">
        $(document).ready(function(){
            var tt =$("input[name=field_type]:checked").val();
            if(tt == 2 || tt == 3){
                $(".daan").attr('style','');
            }else{
                $(".daan").attr('style','display:none');
            }
        });

        $(function(){
            $("input[name=field_type]").click(function(){
                var tt = $(this).val();
                if(tt == 2 || tt == 3){
                    $(".daan").attr('style','');
                }else{
                    $(".daan").attr('style','display:none');
                }
            });
        });
    </script>
@stop